fix(platform/azure): Add current project id as sourceRepositoryId to azure getPrList #32991
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
... to avoid that the bot needs read permissions to all PR source repositories
Changes
This PR adds a second
searchCriteria
to the Azure getPrList call. The addedsearchCriteria
is thesourceRepositoryId
with the id of the current project. This has the effect that only pull requests are returned, which have their sources in branches of the current project or in other words no pull requests from forks are returned.Context
This PR tries to solve the problem that the user account associated with "Renovate-Git-Token" requires read access to any source repository from which pull requests are created.
Without the read access currently the getPrList call fails and an exception like this is reported:
I'm not sure if the restriction to PRs only from the current repository has unwanted sideeffects.
Maybe the PR can be changed to be a solution strategie if the fetching of all PRs fails?
Is there a requirement for renovate to see all available PRs including forks?
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: